﻿#ifndef _BRICK_H
#define _BRICK_H

#include "Object.h"
#include "Sprite.h"

#define BRICK_GRAVITY         0.01

class Brick : public Object
{
	Sprite* _spriteArr[4];
	bool isBreaked;

	float   xBreak1;                //Tham số của các mảnh vỡ. 1 là mảnh trên, 2 là mảnh dưới
	float   yBreak1;
	float   xBreak2;
	float   yBreak2;
	float   vyBreak1;
	float   vyBreak2;
	float   vxBreak1;
	float   vxBreak2;
	float   ayBreak;
	float   angle;

public:
	/*
	 *	Get/set Properties
	 */
	OBJECT_TYPE getObjectType();

	/*
	*      Constructor
	*/
	Brick(LPDIRECT3DDEVICE9 d3ddv, LPDIRECT3DSURFACE9 BackBuffer, LPD3DXSPRITE SpriteHandler, float x, float y, int ID, int Obj_state);
	~Brick();


	/*
	 *      Method
	*/
	void render(int cameraX, int cameraY);
	void update(list<Object*>* obj_list, DxInput* input, float TPF);

	void changeState(int state);

};

#endif